<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="it" uri="/pager-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>办公管理系统-管理</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="Cache-Control" content="no-cache, must-revalidate"/>
	<meta name="Keywords" content="keyword1,keyword2,keyword3"/>
	<meta name="Description" content="网页信息的描述" />
	<meta name="Author" content="itcast.cn" />
	<meta name="Copyright" content="All Rights Reserved." />
	<link rel="stylesheet" type="text/css" href="css/pager.css"/>
	<script type="text/javascript">
		window.onload = function(){
			document.getElementById("addNotice").onclick = function(){
				window.location = "${pageContext.request.contextPath}/showAddNotice.action";
			};
			
			document.getElementById("search").onclick = function(){
				window.location = "${pageContext.request.contextPath}/showSearch.action";
			};
		};
	</script>
</head>
<body>
	<table align="center">
		<tr>
			<td>
				<input type="button" value="添加" id="addNotice"/>
				<input type="button" value="搜索" id="search"/>
			</td>
		</tr>
	</table>
	<table align="center" width="80%" border="1" style="border-collapse: collapse;">
		<tr>
			<th width="4%">编号</th>
			<th width="20%">标题</th>
			<th>内容</th>
			<th width="8%">操作</th>
		</tr>
		<s:iterator value="notices">
			<tr>
				<td><s:property value="id"/></td>
				<td><s:property value="title"/></td>
				<td><s:property value="content" escapeHtml="false"/></td>
				<td>
					<a href="${pageContext.request.contextPath}/showUpdateNotice.action?notice.id=${id}">修改</a>|
					<a href="${pageContext.request.contextPath}/deleteNotice.action?notice.id=${id}">删除</a>
				</td>
			</tr>
		</s:iterator>
	</table>
	
	
	<it:pager pageIndex="${pageModel.pageIndex}" 
				  pageSize="${pageModel.pageSize}" 
				  recordCount="${pageModel.recordCount}" 
				  submitUrl="${pageContext.request.contextPath}/selectNotice.action?pageModel.pageIndex={0}"/>
</body>
</html>